
#include "stdafx.h"

#include <windows.h>
#include <tlhelp32.h>
#include <tchar.h>




#include "ProcessListTester.h"

bool IsMonitorLizardProcessRunning()
{
  HANDLE hProcessSnap;
//  HANDLE hProcess;
  PROCESSENTRY32 pe32;
//  DWORD dwPriorityClass;

  // Take a snapshot of all processes in the system.
  hProcessSnap = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );
  if( hProcessSnap == INVALID_HANDLE_VALUE )
  {
    return( false );
  }

  // Set the size of the structure before using it.
  pe32.dwSize = sizeof( PROCESSENTRY32 );

  // Retrieve information about the first process,
  // and exit if unsuccessful
  if( !Process32First( hProcessSnap, &pe32 ) )
  {
    CloseHandle( hProcessSnap );          // clean the snapshot object
    return( false );
  }

  // Now walk the snapshot of processes, and
  // display information about each process in turn
  do
  {
    if ( wmemcmp( pe32.szExeFile, L"MonitorLizard.exe",18) ==0 )
			return ( true );


  } while( Process32Next( hProcessSnap, &pe32 ) );

  CloseHandle( hProcessSnap );
  return( false );
}






